home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Java for 3D & VRML Worlds
/
Java for 3d and VRML Worlds.iso
/
vs
/
browser
/
cpb10ebx.exe
/
DATA.Z
/
manual.java
< prev
next >
Wrap
Text File
|
1996-10-16
|
1KB
|
65 lines
/*
* File : manual.java (Script for Community Place)
* Version : 2.0- 1996.09.11
* Auther : cori co.
*
* Copyright(C) 1996 Sony Corporation. All rights reserved.
*/
import vrml.*;
import vrml.field.*;
import vrml.node.*;
import java.util.*;
import vs.*;
/* This is a sample script for event handler.*/
public class manual extends Script {
SFBool CubeSw;
boolean CubeRotateFlg = false;
/*
* Initialize
*/
public void initialize() {
CubeSw = (SFBool) getEventOut( "Cube_switch" );
}
/*
* eventIn
*/
public void processEvent( Event e ) {
String name = e.getName();
if ( name.equals( "CubeClick" )) {
CubeClick( (ConstSFBool)e.getValue() );
} else {
;
}
}
/*
* Clicked on the cube
*/
public void CubeClick( ConstSFBool state ) {
if ( !state.getValue() ) { /* != mouseDown */
if ( CubeRotateFlg == false ) {
CubeRotateFlg = true;
CubeSw.setValue( true );
} else {
CubeRotateFlg = false;
CubeSw.setValue( false );
}
}
}
}